import React,{lazy} from 'react'
import {
  AppOutline,
  UnorderedListOutline,
} from 'antd-mobile-icons'

const MainLayout = lazy(()=>import('../pages/mainLayout'));
const Home = lazy(()=>import('../pages/home'));
const Order = lazy(()=>import('../pages/order'));
const OrderOk = lazy(()=>import('../pages/orderOk'));
const Pay = lazy(()=>import('../pages/pay'));

export const homeRoutes = [
    {
        path:'/home',
        element:<Home></Home>,
        title:'首页',
        icon:<AppOutline />,
    },
    {
        path:'/order',
        element:<Order></Order>,
        title:'订单',
        icon:<UnorderedListOutline />,
    },
]

export const routes = [
    {
        path:'/',
        element: <MainLayout></MainLayout>,
        children:[
            ...homeRoutes,
            {
                path:'/',
                element:<Home></Home>
            }
        ]
    },
    {
        path:'/pay',
        element:<Pay></Pay>,
    },
    {
        path:'/orderOk',
        element:<OrderOk></OrderOk>,
    }
]